package com.hongning.railway.ui.main.fragments;

import android.arch.lifecycle.ViewModelProviders;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.hongning.railway.BR;
import com.hongning.railway.R;
import com.hongning.railway.app.AppViewModelFactory;
import com.hongning.railway.databinding.FragmentMineBinding;

import me.goldze.mvvmhabit.base.BaseFragment;


public class Minefragment extends BaseFragment<FragmentMineBinding,MineViewModel> {


    public static Minefragment newInstance() {
        return new Minefragment();
    }


    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_mine;
    }

    @Override
    public int initVariableId() {
        return BR.mineviewmodel;
    }

    @Override
    public void initData() {
        super.initData();
        viewModel.loadScoreInfo();
    }

    @Override
    public MineViewModel initViewModel() {
        AppViewModelFactory appViewModelFactory = AppViewModelFactory.getInstance(getActivity().getApplication());
        return ViewModelProviders.of(this,appViewModelFactory).get(MineViewModel.class);
    }
}
